<?php
/**
 * Description of NaviagtionSetup
 *
 * @author Pauli
 */

class Fifa_Controller_Plugin_NavigationSetup extends Zend_Controller_Plugin_Abstract {
    
    public function routeShutdown(Zend_Controller_Request_Abstract $request) {
        
        $view = Zend_Layout::getMvcInstance()->getView();
        
        $moduleRequest = $request->getModuleName();
        
        switch ($moduleRequest) {
            case 'admin':
                $navConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigationAdmin.xml');
                break;
            case 'default':
            default:
                $navConfig = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml');
                break;
        }
        
        
        $navContainer = new Zend_Navigation($navConfig);
        
        $view->navigation($navContainer);
    }
}